<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/23/023
 * Time: 9:46
 */

namespace app\api\service;


class Admin {

    /**
     * 验证管理员密码是否正确
     * @param $admin
     * @param $password
     * @return bool
     */
    public static function checkAdminPassword($admin, $password) {
        $admin_password = $admin['password'];
        $post_password = md5($admin['salt'] . $password);
        if ($admin_password == $post_password) {
            return true;
        } else {
            return false;
        }
    }
}